import React from 'react'
import { FlatList } from 'react-native'
import { EventItem } from './event-item'

export const Events = ({ data, loading, onRefresh }) => (
  <FlatList
    data={data}
    refreshing={loading}
    onRefresh={onRefresh}
    keyExtractor={x => x.id}
    renderItem={({ item }) => <EventItem event={item} />}
  />
)
